/*
 * @Description: 网关，Cookie配置
 * @Author: seadon
 * @LastEditors: zhaoxiaoyang zhaoxiaoyang@byteluck.com
 * @Date: 2022-03-07 16:00:59
 * @LastEditTime: 2024-01-15 11:05:20
 */
// 常用环境
const EnvType = {
	DEV: {
		gateway: 'https://szxy.ppsuc.edu.cn/',
		cookies:
			'tenant_id=gadx; local=zh-CN; equipment=9ebabfe19dd2405a9a4cb907e03e47cd; egoToken=15ee6377-f213-4b5e-afc6-393b24903808',
	},
	TEST: {
		gateway: 'https://testqw.baiteda.com/',
		cookies:
			'designertoken=854def17-0913-4228-bce9-1fe9a8056d38; egoToken=c1bbc6cd-254b-4796-8c1e-468f38f0cab6; tenant_id=gadx; local=zh-CN; equipment=f8a1740c5e9c47d88a3181acbbaaa716',
	},
	HOTFIX: {
		gateway: 'https://hotfix.baiteda.com',
		cookies:
			'designertoken=3eaf5732-284b-4d91-bb3a-21ee9f67c62d; sensorsdata2015jssdkcross=%7B%22%24device_id%22%3A%2218a833b5ee424e-06fadf7b66546b8-19525634-3686400-18a833b5ee5d42%22%7D; AGL_USER_ID=199af3e2-2a6f-4b05-bf05-caaa3a044af3; Hm_lvt_6aa3bb5bcd9f8bea50e5944c4a3eb80c=1695891687,1697706206; adminToken=ecc8e4f7-f860-4dcc-bf8c-1341aad5b327; dept_id=d81g9gcf87ade6dd; label_id=1; egoToken=df2a22d7-1522-4240-82fd-de11766d2893; tenant_id=hotfix; equipment=5a2236a0311844c89b7092b57828ee9c; sa_jssdk_2015_hotfix_baiteda_com=%7B%22distinct_id%22%3A%22hotfix_111157d9%22%2C%22first_id%22%3A%221877444987611d2-06b156bced63614-1e525634-1764000-1877444987710ab%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%2C%22%24latest_referrer%22%3A%22%22%7D%7D; local=zh-CN',
	},
	CHECK: {
		gateway: 'https://check.baiteda.com',
		cookies:
			'sensorsdata2015jssdkcross=%7B%22%24device_id%22%3A%22181d6368ddda2-0d6815e9aa74ba8-1c535633-1296000-181d6368ddeb7%22%7D; tenant_id=check; egoToken=e6f76ea3-a634-4293-ab10-f00066220c5d; local=zh-CN; sajssdk_2015_new_user_check_baiteda_com=1; sa_jssdk_2015_check_baiteda_com=%7B%22distinct_id%22%3A%22check_MaFeiXiang%22%2C%22first_id%22%3A%22181d7eb58c017-0a7b0c6e6815e98-1c535633-1296000-181d7eb58c138b%22%2C%22props%22%3A%7B%7D%7D; equipment=5cfbc73faf8e44bc8ad8dfaf92cc48f8',
	},
	TESTFEISHU: {
		gateway: 'https://testfeishu.baiteda.cn',
		cookies:
			'tenant_id=testfeishu; egoToken=43f5401f-f977-48c8-b75e-7fedb20373f7; local=ja-JP; equipment=a4c8069a59fb42f1bb1a69effd92084e',
	},
	lihuamuye: {
		gateway: 'https://clouddev.lihuamuye.com/',
		cookies:
			'tenant_id=lhmy; local=zh-CN; label_id=1; local=zh-CN; equipment=9592b1ac36e34e9a9cc93081248c9c1a; org_id=1489015730073503744; egoToken=89f07b9a-d74b-4ba0-881b-524709c02841',
	},
	ERJIMULU: {
		gateway: 'https://zhongtieerjimulu.yigowork.com/citiccard/eams/',
		cookies:
			'sensorsdata2015jssdkcross=%7B%22%24device_id%22%3A%22188b2a2a7adfa9-0e1eb120cc84e18-26031a51-1821369-188b2a2a7ae12f2%22%7D; adminToken=127fd8e0-19a6-45cf-a571-3849c804e0a9; org_id=DHGBRJKG; label_id=1; egoToken=78a07b35-a474-4133-af69-0790f91285cc; designertoken=ac8728c8-c1e7-4a5d-9f99-f9d946ccc4e4; tenant_id=bdzc; sub_context_path=/citiccard/eams; local=zh-CN',
	},
}

// 当前使用环境
const { gateway, cookies } = EnvType.DEV

const headers = {
	Cookie: cookies,
	Referer: gateway,
	origin: gateway,
}

// proxyTable
const devServer = {
	// https: true,
	proxy: {
		'/ego_api/v3': {
			target: gateway,
			headers,
			changeOrigin: true,
		},
		'/ego_api/auth': {
			target: gateway,
			headers,
			changeOrigin: true,
		},
		'/portal/api': {
			target: gateway,
			headers,
			changeOrigin: true,
		},
		'/apps/api': {
			target: gateway,
			headers,
		},
		'/ego_base_info/api/public/tenant/getPlatformIn': {
			target: 'https://open.pri.yigowork.com/',
			headers: {
				Cookie: cookies,
				Referer: 'https://open.pri.yigowork.com/',
				origin: 'https://open.pri.yigowork.com/',
			},
		},
		'/ego_base_info': {
			target: gateway,
			headers,
		},
		'/ego_api/client': {
			target: gateway,
			headers,
		},
		'/user_center': {
			target: 'https://user-center-test.baiteda.com',
			headers,
		},
	},
}

module.exports = devServer
